<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 500px;
            height: 300px;
            text-align: center;
            font-size: 26px;
            padding-top: 200px;
            background-color: dimgray;
            color: pink;
            margin: 100px auto;
        }
    </style>
</head>

<body>
    <a href="#/home">首页</a>
    <a href="#/service">服务</a>
    <a href="#/mine">个人中心</a>
    <a href="#/bottom">联系方式</a>
    <div></div>
</body>

</html>
<script>

    window.onhashchange = function () {
        switch (location.hash) {
            case "#/home": home_page(); break
            case "#/service": service_page(); break
            case "#/mine": mine_page(); break
            case "#/bottom": bottom_page(); break
        }
    }
    const div = document.querySelector('div')
    function home_page() {
        div.innerHTML = '我是首页，，是你们的老大，你们逗得听我的'
    }
    function service_page() {
        div.innerHTML = '我是服务，，我才是你们的老大，你们逗得听我的'
    }
    function mine_page() {
        div.innerHTML = '我是个人中心，，是你们的自己，你们逗得听我的'
    }
    function bottom_page() {
        div.innerHTML = '我是，，是你们的老大，你们逗得听我的'
    }

</script>